import request from '@/utils/request'

///api/sw/sync/configs get 获取同步配置列表
export function listSyncConfig(params) {
  return request({
    url: '/basic/api/sw/sync/configs',
    method: 'get',
    params
  })
}

// /api/sw/sync/config/{configId} get 获取同步配置详情
export function detailSyncConfig(id) {
  return request({
    url: '/basic/api/sw/sync/config/'+id,
    method: 'get'
  })
}

//addSyncConfig  /api/sw/sync/config post 新增
export function addSyncConfig(data) {
  return request({
    url: '/basic/api/sw/sync/config',
    method: 'post',
    data
  })
}

// /basic/api/sw/sync/config/{configId} put 更新
export function updateSyncConfig(id,data) {
  return request({
    url: '/basic/api/sw/sync/config/'+id,
    method: 'put',
    data
  })
}

// /api/sw/sync/config/{configId} delete
export function deleteSyncConfig(id) {
  return request({
    url: '/basic/api/sw/sync/config/'+id,
    method: 'delete'
  })
}

// /api/sw/sync/start post 启动同步任务
export function startSync(data) {
  return request({
    url: '/basic/api/sw/sync/start',
    method: 'post',
    data
  })
}

// 获取查看详情的详情  /api/sw/sync/config/{configId}/tasks get
export function getDetailTable(id) {
  return request({
    url: `/basic/api/sw/sync/config/${id}/tasks`,
    method: 'get'
  })
}